package com.mifengkong.cygtools.jjcard;

import tgio.rncryptor.RNCryptorNative;

/**
 * Created by jiangyongxing on 2018/2/1.
 * 描述：
 */

public class FRBaseAESUtil {

    /**
     * 加密
     *
     * @param content  需要加密的内容
     * @param password 秘钥
     * @return
     */
    public static String encrypt(String content, String password) {
        RNCryptorNative rncryptor = new RNCryptorNative();

        String encrypted = new String(rncryptor.encrypt(content, password));

        return encrypted;

    }


    /**
     * 解密
     *
     * @param content  需要解密的内容
     * @param password 秘钥
     * @return
     */
    public static String decrypt(String content, String password) {

        RNCryptorNative rncryptor = new RNCryptorNative();

        String decrypted = new String(rncryptor.decrypt(content, password));

        return decrypted;

    }
}
